package com.wangyg.flourfactory.configuration;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Created by wangyg6 on 2019/5/21 19:37.
 */
@Configuration
public class RestTemplateCreator {
	@Bean("lbRestTemplate")
	@LoadBalanced
	public RestTemplate getRestTemplate() {
		return new RestTemplate();
	}

	@Bean("restTemplate")
	public RestTemplate getRestTemplate2() {
		return new RestTemplate();
	}

	@Bean
	public ApplicationContextHolder getHolder() {
		return new ApplicationContextHolder();
	}
}
